package com.xq.springboot.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author xq
 * @version 1.0
 * @date 2021/4/16 13:49
 * @description
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Validated
public class Teacher {
    @NotNull // 不能为空
    private Integer id;

    @NotBlank // 不能为空以及不能空白
    private String name;

    @NotNull // 不能为空
    private Integer age;

    @Email // 效验邮箱格式
    private String email;
}
